<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\BlogProfile
 *
 * @property int $id 爱好表主键id
 * @property int $uid 用户id
 * @property string|null $hobby 爱好
 * @property int $status 状态
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile query()
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile whereHobby($value)
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|BlogProfile whereUid($value)
 * @mixin \Eloquent
 * @property-read \App\Models\BlogUser|null $user
 */
class BlogProfile extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    public $hidden = ['id','uid'];

    //反向一对一关联
    public function user()
    {
        return $this->belongsTo(BlogUser::class,'uid','id');
    }
}
